using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneView : View
{
    public static SceneView currentScene;
    public RectTransform root;
    public override void Start()
    {
        base.Start();
        currentScene = this;
        if (root == null)
        {
            var rootGameObjects = SceneManager.GetActiveScene().GetRootGameObjects();
            for (var i = 0; i < rootGameObjects.Length; i++)
            {
                var rectTransform = rootGameObjects[i].GetComponent<RectTransform>();
                if (rectTransform != null)
                {
                    root = rectTransform;
                    break;
                }
            }
        }
    }
    public virtual void OnDestroy()
    {
        currentScene = null;
    }
}